﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.Objects.DataClasses;

namespace PhoneStore.Entity
{

    public partial class DienThoaiEntities
    {
        public ObjectSet<T> GetObjectSet<T>() where T : EntityObject
        {
            return typeof(DienThoaiEntities).GetProperties()
                .Where(x => x.PropertyType == typeof(ObjectSet<T>))
                .SingleOrDefault().GetValue(this,null) as ObjectSet<T>;
        }
    }
}
